<template>
  <h2>我是About的内容</h2>
</template>

<script>
export default {
  // eslint-disable-next-line vue/multi-word-component-names
  name: "About",
  beforeDestroy() {
    console.log('About组件即将被销毁了')
  },
  mounted() {
    console.log('About组件挂载完毕了', this)
    window.aboutRoute = this.$route
    window.aboutRouter = this.$router
  },
  beforeRouteEnter(to, from, next) {
    console.log('beforeRouteEnter', to, from)
    if (to.meta.isAuth) {
      if (localStorage.getItem('school') === 'atguigu') {
        // document.title = to.meta.title || 'xxx系统'
        next()
      } else {
        alert('学校名不对，无权限查看！')
      }
    } else {
      // document.title = to.meta.title || 'xxx系统'
      next()
    }
  },
  beforeRouteLeave(to, from, next) {
    console.log('About -- beforeRouteLeave', to, from, next)
    next()
  }
}
</script>
